import { defineStore } from "pinia";
import { ref } from "vue";

export const useToken = defineStore("token", () => {
    const token = ref<string | null>(null)
    const getToken = () => {
        return token.value
    }
    const setToken = (value: string) => {
        token.value = value
    }
    const removeToken = () => {
        token.value = null
    }
    return { token, getToken, setToken, removeToken }
}, {
    persist: true
})